package com.ruoyi.verify.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.verify.domain.VerifyLevel;
import com.ruoyi.verify.service.IVerifyLevelService;

/**
 * 现场审核等级 提供者
 * 
 * @author ruoyi
 * @date 2020-10-14
 */
@RestController
@RequestMapping("level")
public class VerifyLevelController extends BaseController
{
	
	@Autowired
	private IVerifyLevelService verifyLevelService;
	
	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{levelid}")
	public VerifyLevel get(@PathVariable("levelid") String levelid)
	{
		return verifyLevelService.selectVerifyLevelById(levelid);
		
	}
	
	/**
	 * 查询现场审核等级列表
	 */
	@GetMapping("list")
	public R list(VerifyLevel verifyLevel)
	{
		startPage();
        return result(verifyLevelService.selectVerifyLevelList(verifyLevel));
	}
	
	
	/**
	 * 新增保存现场审核等级
	 */
	@PostMapping("save")
	public R addSave(@RequestBody VerifyLevel verifyLevel)
	{		
		return toAjax(verifyLevelService.insertVerifyLevel(verifyLevel));
	}

	/**
	 * 修改保存现场审核等级
	 */
	@PostMapping("update")
	public R editSave(@RequestBody VerifyLevel verifyLevel)
	{		
		return toAjax(verifyLevelService.updateVerifyLevel(verifyLevel));
	}
	
	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{		
		return toAjax(verifyLevelService.deleteVerifyLevelByIds(ids));
	}
	
}
